/*
 * ============================================================================
 *
 *       Filename:  checkFile.h
 *
 *    Description:  Definitions for RegEx-Patterns, the type for stored
 *                  includes and the prototypes for fileparsing functions.
 *
 *        Version:  1.0
 *        Created:  12/08/11 18:32:57
 *       Revision:  $Revision$
 *       Compiler:  gcc
 *
 *         Author:  Markus Sebastian Schmitz, 
 *        Company:  
 *
 * ============================================================================
 */

#ifndef PARSEFILE_H
#define PARSEFILE_H
#include <regex.h>

#define KEYWORD_FILE "keywords.ini"
#define KEYWORD_DELIMITER ","
#define SYS_INCLUDE_PATTERN "#include[[:space:]]?\<[[:alnum:]]+\.[a-zA-Z]\>"
#define USR_INCLUDE_PATTERN "#include[[:space:]]?\"[[:alnum:]]+\.[a-zA-Z]\""
#define WORD_PATTERN "[a-zA-Z]{2,}"

#define MAX_LINE_LENGTH 200
#define INCLUDE_BUFFER 5 /* Start size of include array */

enum sys_or_usr { usr, sys };
typedef struct {
    char *includedFile;
    enum sys_or_usr type;
} includer;

int checkFile(char *fileContent);
static int findIncludes(const char *fileContent, char ***includeString);
static int checkDefinition(const char *word, const char **includes, int includeCount);
static int checkWords(const char *fileContent, const char **includes, int includeCount);
static int getHash(const char *word);

#endif
